fix(security): Remove exposed development credentials from login page#23
Open
Lexicoding-systems wants to merge 1 commit intomainfrom
Open
fix(security): Remove exposed development credentials from login page#23Lexicoding-systems wants to merge 1 commit intomainfrom
Lexicoding-systems wants to merge 1 commit intomainfrom
Conversation
…re config Fixes #17 ## Changes ### Security Fix - Dev credentials now hidden by default (display: none) - Only visible when IS_DEV = true (localhost or explicitly set) - No credentials visible in production page source ### Environment Configuration - Added ENV detection (checks window.LEXECON_ENV or hostname) - API_BASE now environment-aware: - Development: http://localhost:8000 - Production: uses window.location.origin + '/api' - Can override with window.LEXECON_API_BASE ### How to Enable Dev Mode **Option 1: Automatic (localhost)** - Runs on localhost or 127.0.0.1 - Credentials show automatically **Option 2: Manual Override** ```html <script> window.LEXECON_ENV = 'development'; </script> <script src="login.html"></script> ``` ## Testing - ✅ Production: No credentials visible - ✅ Localhost: Credentials show automatically - ✅ API_BASE adjusts per environment - ✅ No breaking changes to login functionality Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #17 - Removes security vulnerability where development credentials were hardcoded and visible in production login page.
Changes Made
🔒 Security Fix
<div>now hasdisplay: noneinline styleIS_DEV = true⚙️ Environment Configuration
IS_DEVchecks:window.LEXECON_ENV === 'development'ORhostname === 'localhost'ORhostname === '127.0.0.1'http://localhost:8000window.location.origin + '/api'window.LEXECON_API_BASEmanuallyHow It Works
Production Deployment (Default)
Development (Automatic)
When running on
localhostor127.0.0.1:Development (Manual Override)
For staging or demo environments:
Testing Performed
Security Impact
Before:
After:
Files Changed
login.html- Security fix and environment configurationRelated Issues
Next Steps
dashboard.html(Issue [CONFIG] Implement Environment Configuration System for API URLs #18)governance_dashboard.html(Issue [CONFIG] Implement Environment Configuration System for API URLs #18)Checklist
🧪 How to Test
Test 1: Production Safety
display: noneTest 2: Development Mode
localhost:8080Test 3: Manual Override
<script>window.LEXECON_ENV = 'development';</script>before loading login.htmlCo-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com